/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef DEVICES_E28_CONFIG_H
#define DEVICES_E28_CONFIG_H

/*!
 * \brief E28State Mode Group
 */
typedef enum
{
		BUSY_ON																	= 0x01,
		BUSY_OFF																= 0x00,
}E28State_Busy_t;

typedef enum
{
	RESERVED_COMMAND_NONE                     = 0x00,
	TRANS_PROCESS_SUCCESS											= 0x01,
	DATA_AVAILABLE_HOST												= 0x02,
	COMMAND_TIMEOUT														= 0x03,
	COMMAND_PROCESS_ERROR											= 0x04,
	FAIL_EXECUTE_COMMAND											= 0x05,
	COMMAND_TX_DONE														= 0x06,
}E28State_Command_t;

typedef enum
{
	RESERVED_CIRCUIT_NONE											= 0x00,
	STDBY_RC_MODE															= 0x02,
	STDBY_XOSC_MODE														= 0x03,
	FS_MODE																		= 0x04,
	RX_MODE																		= 0x05,
	TX_MODE																		= 0x06,
}E28State_Circuit_t;



/*!
 * \brief Set StandBy Mode Group
 */
typedef enum
{
    STDBY_RC                                = 0x00,
    STDBY_XOSC                              = 0x01,
}SX1280_StandbyModes_t;



/*!
 * \brief Set Packet Type Group
 */
typedef enum
{
    PACKET_TYPE_GFSK                        = 0x00,
    PACKET_TYPE_LORA,
    PACKET_TYPE_RANGING,
    PACKET_TYPE_FLRC,
    PACKET_TYPE_BLE,
    PACKET_TYPE_NONE                        = 0x0F,
}SX1280_PacketTypes_t;



/*!
 * \brief Set Rf Frequency Group
 */
typedef enum
{
	RF_2G3_Frequency 													= 0xB89D89,
	RF_2G4_Frequency 													= 0xB8EC4E,
}SX1280_RfFrequency_t;



/*!
 * \brief Set Buffer Base Address Group
 */
typedef enum
{
	BUF_Tx_BASEADDRESS_DEFAULT								= 0X00,
	BUF_Rx_BASEADDRESS_DEFAULT								= 0x00,
}SX1280_RxTxBaseAddress_t;



/*!
 * \brief Set Modulation Params.
 */
typedef enum
{
    LORA_SF_5                                = 0x50,
    LORA_SF_6                                = 0x60,
    LORA_SF_7                                = 0x70,
    LORA_SF_8                                = 0x80,
    LORA_SF_9                                = 0x90,
    LORA_SF_10                               = 0xA0,
    LORA_SF_11                               = 0xB0,
    LORA_SF_12                               = 0xC0,
}SX1280_LoRaSpreadingFactors_t;

typedef enum
{
	LORA_BW_1600															 = 0x0A,
	LORA_BW_800																 = 0x18,
	LORA_BW_400																 = 0x26,
	LORA_BW_200																 = 0x34,
}SX1280_LoRaBandwidths_t;

typedef enum
{
	LORA_CR_4_5																 = 0x01,
	LORA_CR_4_6																 = 0x02,
	LORA_CR_4_7 															 = 0x03,
	LORA_CR_4_8 															 = 0x04,
	LORA_CR_LI_4_5														 = 0x05,
	LORA_CR_LI_4_6														 = 0x06,
	LORA_CR_LI_4_7														 = 0x07,
}SX1280_LoRaCodingRates_t;



/*!
 * \brief Set Packet Params
 */
/* Send FrontSync How Many time */
typedef enum
{
	LORA_PBLE_LEN_MANT_5 											 = 0x05,
}SX1280_FrontSyncTimes_t;

/* Complex(Bit Num) of the FrontSync */
typedef enum
{
	LORA_PBLE_LEN_EXP_5												 = 0x05,
}SX1280_FrontSyncComplex_t;

/* PBLE Header isVisible */
typedef enum
{
	EXPLICIT_HEADER														 = 0x00,
	IMPLICIT_HEADER														 = 0X80,
}SX1280_IsHeaderVisible_t;

/* Payload Length */
typedef enum
{
	PAYLOAD_LENGTH_FULL												 = 255,
	PAYLOAD_LENGTH_HALF												 = 128,
}SX1280_PayloadLength_t;

/* Is CRC Use */
typedef enum
{
	LORA_CRC_ENABLE														 = 0x20,
	LORA_CRC_DISABLE													 = 0x00,
}SX1280_IsCRCUse_t;

/* Is IQ Filp */
typedef enum
{
	LORA_IQ_STD																 = 0x40,
	LORA_IQ_INVERTED													 = 0X00,
}SX1280_IsIQFilp_t;



/*!
 * \brief Set Tx Params
 */
typedef enum
{
	TX_POWER_27DBM														 = 0x2D,
	TX_POWER_25DBM														 = 0x2B,
}SX1280_TxPower_t;

typedef enum
{
	RADIO_RAMP_02_US													 = 0x00,
	RADIO_RAMP_04_US													 = 0x20,
	RADIO_RAMP_06_US													 = 0x40,
	RADIO_RAMP_08_US													 = 0x60,
	RADIO_RAMP_10_US													 = 0x80,
	RADIO_RAMP_12_US													 = 0xA0,
	RADIO_RAMP_16_US													 = 0xC0,
	RADIO_RAMP_20_US													 = 0xE0,
}SX1280_RampTime_t;



/*!
 * \brief Write Buffer
 */
typedef enum
{
	BUFFER_OFFSET_DUFAULT											 = 0x00,
}SX1280_Offset_t;



/*!
 * \brief Set DioIrq Params & Clear Irq State
 */
typedef enum
{
	TxDone																		 = 0x01,
	RxDone																		 = 0x02,
	SyncWordValid															 = 0x04,
	SyncWordError															 = 0x08,
	HeaderValid																 = 0x10,
	HeaderError																 = 0x20,
	CrcError																	 = 0x40,
	RangingSlaveResponseDone									 = 0x80,
	RangingSlaveRequestDiscard								 = 0x100,
	RangingMasterResultValid									 = 0x200,
	RangingMasterTimeout											 = 0x400,
	RangingMasterRequestValid									 = 0x800,
	CadDone																		 = 0x1000,
	CadDetected																 = 0x2000,
	RxTxTimeout																 = 0x4000,
	PreaDetected_AdvRanging_Done							 = 0x8000,
	Irq_All																		 = 0xFFFF
}SX1280_IrqRegister_t;	



/*!
 * \brief Set Tx & Set Rx
 */
typedef enum
{
	PERIODBASE_15U625														= 0X00,
	PERIODBASE_62U5															= 0X01,
	PERIODBASE_1MS															= 0x02,
	PERIODBASE_4MS															= 0x03
}SX1280_PeriodBase_t;

typedef enum
{
	PERIODBASECOUNT_TxRxSingle									= 0x00,
	PERIODBASECOUNT_RxContinuous								= 0xFFFF,
	
	PERIODBASECOUNT_1T													= 0x01,
	PERIODBASECOUNT_2T													= 0x02,
	PERIODBASECOUNT_5T													= 0x05,
	PERIODBASECOUNT_10T													= 0x0A,
}SX1280_PeriodBaseCount_t;


/* End -----------------------------------------------------------------------*/
#endif
